//字酷云

 $(function ()
            {      	
            init("","","");
         
			   var   fanlimall = {
	               "shang"    : { name:"商",cell: { 
				                                    "zhbh":{name :"综合百货"},
							                        "fzfs":{name:"服装服饰"},
													"sjsm":{name:"手机数码"},
													"tsyx":{name:"图书音像"},
													"dnbjb":{name:"电脑笔记本"},
													"hzmr":{name:"化妆美容"},
													"hwxx":{name:"户外休闲"},
													"jydq":{name:"家用电器"},
													"jjsh":{name:"居家生活"},
													"myyp":{name:"母婴用品"},
													"bgyp":{name:"办公用品"},
													"wjlp":{name:"玩具礼品"},
													"skrj":{name:"数卡软件"},
													"ypbj":{name:"药品保健"},
													"zbyj":{name:"钟表眼镜"},
													"yydp":{name:"旅游订票"},
													"qcyp":{name:"汽车用品"},
													"spps":{name:"饰品配饰"},
													"cwyp":{name:"宠物用品"},
													"xbpj":{name:"箱包皮具"},
													"spyl":{name:"食品饮料"}
			
																			   }},				                            
                   "tao"   : { name:"淘"},
	               "pai" : { name:"拍"}
	  
               };
var opts = {data: fanlimall,
           ajax: url+"/getmall",
			select: '#fanlimall',
	        head: "选择商城"			
                    };

var linkageSelfanlimall = new LinkageSel(opts);
linkageSelfanlimall.onChange(function() {
		var v = linkageSelfanlimall.getSelectedValue();
		var lurl=linkageSelfanlimall.getSelectedData('url');
		var img=linkageSelfanlimall.getSelectedData('img');
	    var mallname=linkageSelfanlimall.getSelectedData('name');
		if( lurl!= undefined && img != undefined)
		{
		     $("#qgw").attr("href",lurl);
		   
		  $("#im").empty().append('<img src="'+img+'"/>');
		   
			init(mallname);
		}
			
						});
function init(mallname)
{
       
			$.ajax({
			type:"POST",
			url:url+"/getmall_order",
		    data:{name:mallname},
			dataType:"json",
			error:function (XMLHttpRequest, textStatus, errorThrown) {alert('请求错误...'+errorThrown);},
			success:function(data){ 
			$("#shuju").empty();
			$("#shuju").append("购物总金额:"+data.info['sales']+"获利总金额："+data.info['commission']+"返利总金额:"+data.info['fxje']);
				$("#maingrid4").ligerGrid({
                columns: [
				 { display: '日期', name: 'order_time', minWidth: 60 },
                { display: '金额', name: 'sales', minWidth: 60 },
                { display: '获利', name: 'commission', width: 140, align: 'left' },
				{ display: '返利', name: 'fxje', width: 140, align: 'left' },
                { display: '服务费', name: 'fuwufei', minWidth: 140 }
                ], data:eval('(' + data.data + ')') , pageSize: 15, sortName: 'riqi',
                width: '100%', height: '80%', checkbox: false
            });
				  
			        }
		              });
}

				    });